function slowOperation() {
    let result = 0;
    for (let i = 0; i < 1000000; i++) {
        for (let j = 0; j < 1000; j++) {
            result += i * j;
        }
    }
    return result;
}

function processArray(array) {
    let sum = 0;
    for (let i = 0; i < array.length; i++) {
        sum += slowOperation();
    }
    return sum;
}

const array = Array(10).fill(1);

console.time('processArray');
const result = processArray(array);
console.timeEnd('processArray');

console.log(`结果: ${result}`);

